package com.ws.user.permission.service.impl;

import com.ws.common.easyui.util.Page;
import com.github.pagehelper.PageHelper;
import com.ws.user.permission.dao.PermissionMapper;
import com.ws.user.permission.entity.Permission;
import com.ws.user.permission.service.IPermissionService;
import com.ws.common.base.service.Impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PermissionServiceImpl extends BaseServiceImpl<Permission> implements IPermissionService{

	@Autowired
	PermissionMapper permissionMapper;

	@Override
	public List<Permission> list(Permission params) {
		return permissionMapper.list(params);
	}

	@Override
	public List<Permission> list(Permission params, Page page) {
		PageHelper.startPage(page.getPage(),page.getRows(),page.getSortOrder());
		return permissionMapper.list(params);
	}

	@Override
	public Integer save(Permission permission) {
		return this.insertOrUpdate(permission);
	}
}
